home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / lib / ps_show_fonts.pro < prev    next >
Text File  |  1997-07-08  |  4KB  |  150 lines

  1. ; $Id: ps_show_fonts.pro,v 1.4 1997/01/15 03:11:50 ali Exp $
  2. ;
  3. ; Copyright (c) 1993-1997, Research Systems, Inc.  All rights reserved.
  4. ;       Unauthorized reproduction prohibited.
  5.  
  6. ;+
  7. ; NAME:
  8. ;    PS_SHOW_FONTS
  9. ;
  10. ; PURPOSE:
  11. ;    This procedure displays all the PostScript fonts that IDL knows
  12. ;    about, with both the StandardAdobe and ISOLatin1 encodings. Each
  13. ;    display takes a separate page, and each character in each font
  14. ;    is shown with its character index.
  15. ;
  16. ; CATEGORY:
  17. ;    Misc., PostScript, Fonts.
  18. ;
  19. ; CALLING SEQUENCE:
  20. ;    PS_SHOW_FONTS
  21. ;
  22. ; INPUTS:
  23. ;    None.
  24. ;
  25. ; KEYWORDS:
  26. ;    NOLATIN: If set, do NOT output ISOLatin1 encodings.
  27. ;
  28. ; OUTPUTS:
  29. ;    None.
  30. ;
  31. ; COMMON BLOCKS:
  32. ;    None.
  33. ;
  34. ; SIDE EFFECTS:
  35. ;    A PostScript file is produced, one page per font/mapping combination.
  36. ;
  37. ; RESTRICTIONS:
  38. ;    The output file contains almost 70 pages of output. A PostScript
  39. ;    previewer is recommended rather than sending it to a printer.
  40. ;
  41. ; MODIFICATION HISTORY:
  42. ;    12 January 1993, AB, RSI.
  43. ;    12 October 1993, Rob Montgomery, NCAR - added 'nolatin' keyword.
  44. ;-
  45.  
  46. PRO PS_SHOFONT, font_kw
  47. ; Display the font selected by applying font_kw to the DEVICE
  48. ; procedure.
  49.  
  50.   on_error, 2        ; Return to caller if an error occurs
  51.  
  52.   message,/info,font_kw
  53.  
  54.   DEVICE,ysize=9, yoffset=1, xsize=7, xoffset=.75, /inch, /COURIER
  55.   xyouts, !d.x_size/2, !d.y_size+1000, align=.5, /dev, font_kw, font=0
  56.  
  57.   ; Lay the characters and indices out in separate passes to minimize
  58.   ; font switching.
  59.  
  60.   junk = execute('DEVICE,'+font_kw)
  61.   row = 25
  62.   col = 0
  63.   xstep = 1./10.
  64.   ystep = 1./26.0
  65.   for ch = 1, 255 do begin
  66.     s = string(byte(ch))
  67.     if (s eq '!') then s = '!!'
  68.     xyouts, .075 + col * xstep, row*ystep, /norm, font=0, charsize=2.0, s
  69.     if (col eq 9) then begin
  70.       col = 0
  71.       row = row - 1
  72.     endif else col = col + 1
  73.   endfor
  74.  
  75.   row = 25
  76.   col = 0
  77.   xstep = 1./10.
  78.   ystep = 1./26.0
  79.   yoff=ystep * .1
  80.   for ch = 1, 255 do begin
  81.     xyouts, .12 + col * xstep, row*ystep-yoff, /norm, font=0, charsize=.5, $
  82.     string(ch,format='(I0)')
  83.     if (col eq 9) then begin
  84.       col = 0
  85.       row = row - 1
  86.     endif else col = col + 1
  87.   endfor
  88.  
  89.   erase
  90. END
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98. pro ps_show_fonts, nolatin=nolatin
  99. ;    Display all of the fonts with and without ISO encodings.
  100.  
  101.   on_error, 2        ; Return to caller if an error occurs
  102.   olddev = !d.name
  103.   set_plot,'ps'
  104.  
  105.   for i = 0, (1 - keyword_set(nolatin)) do begin
  106.  
  107.     lat = ',ISOLATIN1=' + strcompress(string(i), /remove_all)
  108.  
  109.     ps_shofont, '/COURIER'                + lat
  110.     ps_shofont, '/COURIER,/BOLD'            + lat
  111.     ps_shofont, '/COURIER,/OBLIQUE'            + lat
  112.     ps_shofont, '/COURIER,/BOLD,/OBLIQUE'        + lat
  113.     ps_shofont, '/HELVETICA'                + lat
  114.     ps_shofont, '/HELVETICA,/BOLD'            + lat
  115.     ps_shofont, '/HELVETICA,/OBLIQU'            + lat
  116.     ps_shofont, '/HELVETICA,/BOLD,/OBLIQU'        + lat
  117.     ps_shofont, '/HELVETICA,/NARROW'            + lat
  118.     ps_shofont, '/HELVETICA,/NARROW,/BOLD'        + lat
  119.     ps_shofont, '/HELVETICA,/NARROW,/OBLIQUE'        + lat
  120.     ps_shofont, '/HELVETICA,/NARROW,/BOLD,/OBLIQUE'    + lat
  121.     ps_shofont, '/AVANTGARDE,/BOOK'            + lat
  122.     ps_shofont, '/AVANTGARDE,/BOOK,/OBLIQUE'        + lat
  123.     ps_shofont, '/AVANTGARDE,/DEMI'            + lat
  124.     ps_shofont, '/AVANTGARDE,/DEMI,/OBLIQUE'        + lat
  125.     ps_shofont, '/BKMAN,/DEMI'                + lat
  126.     ps_shofont, '/BKMAN,/DEMI,/ITALIC'            + lat
  127.     ps_shofont, '/BKMAN,/LIGHT'                + lat
  128.     ps_shofont, '/BKMAN,/LIGHT,/ITALIC'            + lat
  129.     ps_shofont, '/ZAPFCHANCERY,/MEDIUM,/ITALIC'        + lat
  130.     ps_shofont, '/SCHOOLBOOK'                + lat
  131.     ps_shofont, '/SCHOOLBOOK,/BOLD'            + lat
  132.     ps_shofont, '/SCHOOLBOOK,/ITALIC'            + lat
  133.     ps_shofont, '/SCHOOLBOOK,/BOLD,/ITALIC'        + lat
  134.     ps_shofont, '/PALATINO'                + lat
  135.     ps_shofont, '/PALATINO,/BOLD'            + lat
  136.     ps_shofont, '/PALATINO,/ITALIC'            + lat
  137.     ps_shofont, '/PALATINO,/BOLD,/ITALIC'        + lat
  138.     ps_shofont, '/TIMES'                + lat
  139.     ps_shofont, '/TIMES,/BOLD'                + lat
  140.     ps_shofont, '/TIMES,/ITALIC'            + lat
  141.     ps_shofont, '/TIMES,/BOLD,/ITALIC'            + lat
  142.   endfor
  143.  
  144.   ps_shofont,'/SYMBOL'
  145.   ps_shofont,'/ZAPFDINGBATS'
  146.   
  147.   DEVICE,/CLOSE
  148.   set_plot,olddev
  149. end
  150.